package com.wxp.controller.mall;

import com.wxp.controller.BaseController;
import com.wxp.service.ArticleService;
import com.wxp.util.IData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.List;

/**
 * 钉钉-智能填表-文章信息
 */
@Controller
@RequestMapping(value = "article")
public class ArticleController extends BaseController {

    @Autowired
    private ArticleService articleService;

    /**
     * 获取“文章”列表
     * @return
     */
    @RequestMapping(value = "getArticleList")
    @ResponseBody
    public Object getArticleList() throws Exception {
        IData idata = IData.getInstance(request);
        List<IData> datas = articleService.getArticleList(idata);
        return datas;
    }

    @RequestMapping(value = "get")
    public String getlist(){
        return "redirect:/article";
    }
}
